//
//  CircleOfPetCollectionViewCell.m
//  LoveOfPet
//
//  Created by 芦彬 on 15/11/13.
//  Copyright © 2015年 孔维. All rights reserved.
//

#import "CircleOfPetCollectionViewCell.h"
#import "LuBDefine.h"
#import "SDWebImageManager.h"
#import "UIImageView+WebCache.h"

@implementation CircleOfPetCollectionViewCell

- (void)dealloc{
    [_recommendImageView release];
    [_recommendImageView release];
    [super dealloc];
}

//初始化
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCircleOfPetCollectionViewCell];
    }
    return self;
}

//创建视图
- (void)createCircleOfPetCollectionViewCell{
    self.recommendImageView = [[UIImageView alloc]init];
    [self addSubview:_recommendImageView];
    [_recommendImageView release];
}

//布局
- (void)layoutSubviews{
    [super layoutSubviews];
    self.recommendImageView.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
}

- (void)setRecommend:(Recommend *)recommend{
    if (_recommend != recommend) {
        [_recommend release];
        _recommend = [recommend retain];
    }
    NSURL *url = [NSURL URLWithString:recommend.cover];
    [self.recommendImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"zhanweitu.jpg"]];
}


@end
